<div class="anchor-tab">
    <ul class="tab">
        <li><a href="/member/anchor">申请提现</a></li>
        <li class="on"><a href="/member/anchor/salary">基本工资</a></li>
        <li><a href="/member/anchor/live_data">直播数据</a></li>
        <li><a href="/member/anchor/gift_data">礼物数据</a></li>
    </ul>
</div>
<div class="anchor-cont">
    <div class="tabs-cont">
        <div class="tableinfo">
            <table class="tabinfo">
                <thead>
                <tr>
                    <th>月份</th>
                    <th>直播有效天</th>
                    <th>累计时长</th>
                    <th>收入(单位:元)</th>
                    <th>税点(50%)</th>
                    <th>实际收入</th>
                </tr>
                </thead>
                <tbody id="J_OrderList">
                <tr>
                    <td colspan="6">加载中...</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="AjaxPagination" class="pagination"></div>
        <!--<div class="intro_tip">-->
        <!--<h3>提示：</h3>-->
        <!--<p>1.第一个月兑换不低于500元，满足其他软性标准可发放1500元底薪，有效天数为每天主麦俩小时，月有效天数>=20天，一个月麦时>=75小时</p>-->
        <!--<p>2.关于底薪发放：例如达到800兑换，完成5个有效天，底薪=800/20*5=200元，兑换=800元，总收入1000 = 200+800RMB</p>-->
        <!--<p>3.底薪转账手续费由艺人承担，到账款项可能小于实际收入</p>-->
        <!--</div>-->

    </div>
</div>
<script>
    $(function () {
        $.ajax({
            url: '/ajaxs/report.anchor-month.list',
            type: 'post',
            dataType: 'json',
            data: {},
            success: function (data) {
                if (data.flag != 0) {
                    $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 3000});
                    return;
                }
                var _html = '';
                if (data.data.length <= 0) {
                    _html = RenderPage(null, data.data.length);
                    $('#J_OrderList').empty().html(_html);
                    return;
                }
                _.forEach(data.data, function (ThisValue) {
                    _html += RenderPage(ThisValue, data.data.length);
                });
                $('#J_OrderList').empty().html(_html);
            }
        })
        //渲染html
        function RenderPage(ThisValue, len) {
            var _html = '';
            if (len <= 0) {
                _html += '<tr>' +
                        '<td colspan="9">' + '暂无礼物数据！' +
                        '</td>' +
                        '</tr>';
            } else {
                ThisValue.Live_Duration_Efftive = (ThisValue.Live_Duration_Efftive > 0) ? (Math.floor(ThisValue.Live_Duration_Efftive / 60) + "小时" + (ThisValue.Live_Duration_Efftive % 60) + "分" ) : 0;
                _html += '<tr>' +
                        '<td>' + moment(ThisValue.Report_Day).format('YYYY-MM') +
                        '</td>' +
                        '<td>' + ThisValue.Live_Day_Efftive +
                        '</td>' +
                        '<td>' + ThisValue.Live_Duration_Efftive +
                        '</td>' +
                        '<td>' + Math.floor(ThisValue.Beans_Anchor_Task / 1000 * 100) / 100 +
                        '</td>' +
                        '<td>' + Math.floor(ThisValue.Beans_Anchor_Task * 0.5 / 1000 * 100) / 100 +
                        '</td>' +
                        '<td>' + Math.floor((ThisValue.Beans_Anchor_Task - ThisValue.Beans_Anchor_Task * 0.5) / 1000 * 100) / 100 +
                        '</td>' +
                        '</tr>';
            }
            return _html;
        }
    });
</script>